<template>
  <div class="content">
    <s-simple-crop class="s-simple" @change="change" icon="portrait" src="" format="Base64" />
  </div>
</template>

<script>
export default {
  name: "home",
  data() {
    return {};
  },
  methods: {
    //获取数据
    getData() {
      const vm = this;
      vm.$http.home.get().then((res) => {
        console.log(res);
      });
    },
    //裁剪返回
    change(e) {
      // 二进制文件流格式
      // let formData = new FormData();
      // formData.append("avatar", e, "avatar.png");
      // console.log(formData.get("avatar")); //打印文件流详细到控制台
      //base64 格式
      console.log(e); //打印base64文件到控制台
    },
  },
  mounted() {
    // this.getData()
  },
};
</script>
<style lang="scss" scoped>
.s-simple {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
}
.content {
  color: red;
  font-size: 20px;
}
</style>